<?php
// remove old meta box
add_action( 'admin_menu', 'cpx_remove_event_metabox');
function cpx_remove_event_metabox() {
   remove_meta_box('tagsdiv-event', 'coupon', 'normal');
} 

//Add new taxonomy meta box
 add_action( 'add_meta_boxes', 'gpj_add_meta_box_event');
 function gpj_add_meta_box_event() {
     add_meta_box( 'gpj-event', 'Select Event','cpx_event_metabox','coupon' ,'side','core');
 }
 function cpx_event_metabox($post) {
        $taxonomy = 'event'; 
        // all terms of ctax
        $all_ctax_terms = get_terms($taxonomy,array('hide_empty' => 0)); 
        // all the terms currenly assigned to the post
        $all_post_terms = get_the_terms( $post->ID,$taxonomy ); 
        // name for each input, notice the extra []
        $name = 'tax_input[' . $taxonomy . '][]';  

        // make an array of the ids of all terms attached to the post
        $array_post_term_ids = array();
        if ($all_post_terms) {
            foreach ($all_post_terms as $post_term) {
                $post_term_id = $post_term->term_id;
                $array_post_term_ids[] = $post_term_id;
            }
        }
        ?>

<div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> 

        <input type="hidden" name="<?php echo $name; ?>" value="0" />

        <ul>
            <?php   foreach($all_ctax_terms as $term){
                    if (in_array($term->term_id, $array_post_term_ids)) {
                        $checked = "checked = ''";
                    }
                    else {
                        $checked = "";
                    }
                $id = $taxonomy.'-'.$term->term_id;
                echo "<li id='$id'>";
                echo "<label><input type='checkbox' name='{$name}'id='in-$id'"
                . $checked ."value='$term->slug' /> $term->name</label><br />";
                echo "</li>";
            } ?>
       </ul>
</div>
<?php
}